package com.example;

import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.apis.AppsV1Api;
import io.kubernetes.client.openapi.models.V1Deployment;
import io.kubernetes.client.openapi.models.V1DeploymentList;
import io.kubernetes.client.util.Config;

import java.io.IOException;

/**
 * @author jukg
 * @date 2025/01/02 18:04
 * @description
 */
public class KubernetesClientExample {
    public static void main(String[] args) {
       /* try {
            // 创建ApiClient并配置
            ApiClient client = Config.defaultClient();
            Configuration.setDefaultApiClient(client);
            // 创建Kubernetes API对象
            AppsV1Api api = new AppsV1Api();
            // 获取所有Deployment
            V1DeploymentList deploymentList = api.listDeploymentForAllNamespaces(null, null, null, null, null, null, null, null, null);
            for (V1Deployment deployment : deploymentList.getItems()) {
                System.out.println("Deployment: " + deployment.getMetadata().getName());
            }
        } catch (ApiException | IOException e) {
            e.printStackTrace();
        }*/

    }
}
